package cn.qin.Actions;

import net.sf.json.JSONArray;

import org.apache.struts2.json.annotations.JSON;
import org.json.JSONException;

import cn.qin.Services.newsServices;

import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionSupport;

public class showOneNewsAction extends ActionSupport {
	public int  id;
	newsServices nes=new newsServices();
	JSONArray JSON = new JSONArray();
	public String execute(){
		return Action.SUCCESS;
	}
	

	public int getId() {
		return id;
	}	
	@JSON(serialize = false)
	public newsServices getNes() {
		return nes;
	}

	public void setNes(newsServices nes) {
		this.nes = nes;
	}

	public void setId(int id) {
		this.id = id;
	}
	@JSON(name="news")
	public JSONArray getJSON() throws JSONException {
		return 		nes.showOneNews(this.getId());
	}
	public void setJSON(JSONArray jSON) {
		this.JSON = jSON;
	}

}
